package com.jeeplus.mob.payUtile;

import java.io.ByteArrayInputStream;
import java.io.File;
import java.io.FileInputStream;
import java.io.InputStream;

public class OurWxPayConfig implements WXPayConfig {
	private byte[] certData;

	public OurWxPayConfig() throws Exception {
//		String certPath = "D:/cert/apiclient_cert.p12"; 
		String certPath = "/usr/local/certificate/apiclient_cert.p12";
//		String certPath = WeChatConfig.CERTIFICATE_URL;
		System.out.println("certPath:"+certPath);
		File file = new File(certPath);
		InputStream certStream = new FileInputStream(file);
		this.certData = new byte[(int) file.length()];
		certStream.read(this.certData);
		certStream.close();
	}

	public String getAppID() {
		return WeChatConfig.APP_ID;
	}

	public String getMchID() {
		return WeChatConfig.MCH_ID;
	}

	public String getKey() {
		return WeChatConfig.APP_KEY;
	}

	public InputStream getCertStream() {
		return new ByteArrayInputStream(this.certData);
	}

	public int getHttpConnectTimeoutMs() {
		return 0;
	}

	public int getHttpReadTimeoutMs() {
		return 0;
	}
}
